<template>
	<view class="common-list u-f animated fadeInLeft fast">
		<view class="common-list-left">
			<image :src="item.userpic"></image>
		</view>
		<view class="common-list-right">
			<view class="u-f-ac">
				<view class="u-f-ac">{{item.username}}
					<view class="icon iconfont" :class="[item.sex==0?'icon-xingbienan':'icon-xingbienv']">{{item.age}}</view>
				</view>
				<view v-if="!isguanzhu" class="icon iconfont icon-tag27fuben" @click="guanzhu()">关注</view>
				<view v-else>
					已关注
				</view>
			</view>
			<view>{{item.title}}</view>
			<view class="u-f-ajc">
				<!--图片-->
				<image v-if="item.titlepic" :src="item.titlepic"></image>
				<!-- 视频 -->
				<template v-if="item.video">
					<view class="common-list-play icon iconfont icon-bofang"></view>
					<view class="common-list-playinfo">
						{{item.video.looknum}} 次播放 {{item.video.long}}
					</view>
				</template>
				<!-- 分享 -->
				<view class="common-list-share u-f-ac" v-if="item.share">
					<image :src="item.share.titlepic"></image>
					<view>{{item.share.title}}</view>
				</view>
			</view>
			<view class="u-f-ac">
				<view>{{item.path}}</view>
				<view class="u-f-ac">
					<view class="icon iconfont icon-forward1">{{item.sharenum}}</view>
					<view class="icon iconfont icon-pinglun">{{item.commentnum}}</view>
					<view class="icon iconfont icon-zan">{{item.goodnum}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isguanzhu: this.item.isguanzhu
			}
		},
		props: {
			item: Object,
			index: Number
		},
		methods: {
			//关注
			guanzhu() {
				this.isguanzhu = true;
				uni.showToast({
					title: '关注成功'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.common-list {
		padding: 20rpx; //内边距

		.common-list-left {
			width: 92rpx;
			flex-shrink: 0; //防止标题长  被压缩

			image {
				width: 90rpx;
				height: 90rpx;
				border-radius: 100%; //变成圆形
			}
		}

		.common-list-right {
			width: 610rpx;
			flex: 1;
			margin-left: 15rpx;
			border-bottom: 1rpx solid #EEEEEE;
			padding-bottom: 10rpx;

			view:nth-child(1) {
				view:first-child {
					color: #999999;
					font-size: 32rpx;

					view {
						background-color: #007AFF;
						color: #FFFFFF;
						font-size: 23rpx;
						padding: 5rpx 10rpx;
						margin-left: 10rpx;
						border-radius: 20rpx;
						line-height: 22rpx;
					}
				}

				view:last-child {
					background-color: #EEEEEE;
					padding: 0 10rpx;
					font-size: 26rpx;
				}
			}

			view:nth-child(2) {
				font-size: 32rpx;
				padding: 12rpx 0;
			}

			view:nth-child(3) {
				position: relative;

				image {
					width: 600rpx;
					border-radius: 10rpx;
				}

				.common-list-play,
				.common-list-playinfo {
					position: absolute;
					color: #FFFFFF;
				}

				.common-list-play {
					font-size: 130rpx;
				}

				.common-list-playinfo {
					font-size: 26rpx;
					right: 10rpx;
					bottom: 10rpx;
					background-color: #333333;
					border-radius: 20rpx;
					padding: 0 20rpx;
				}

				.common-list-share {
					background-color: #EEEEEE;
					width: 100%;
					padding: 0 10rpx;
					border-radius: 10rpx;

					image {
						width: 200rpx;
						height: 150rpx;
						margin-right: 10rpx;
					}
				}

			}

			view:nth-child(4) {
				view {
					color: #aaaaaa;
				}

				view:nth-child(2) {
					view {
						margin-left: 10rpx;
						padding-left: 5rpx;
						font-size: 28rpx;
					}
				}
			}
		}
	}
</style>
